'use strict';


var grpc = require('grpc');
var protoDescriptor = grpc.load(__dirname + '/helloworld.proto');
var helloworld = protoDescriptor.helloworld;
var Server = grpc.buildServer([helloworld.Greeter.service]);

/**Implements the SayHello RPC method*/
function SayHello(call, callback) {
  callback(null, {
    message: 'Hello ' + call.request.name
  });
}

var server = new Server({
  'helloworld.Greeter': {
    sayHello: SayHello // lowcase sayHello , not Sayhello, why
  }
});
server.bind('0.0.0.0:50051');
server.listen();